package com.iwomy.envpro.platform.entity;

import cn.hutool.core.lang.Console;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 基础信息-触发器
 *
 * @author pig
 * @date 2023-09-26 16:42:01
 */
@Data
@TableName("basic_trigger")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "基础信息-触发器")
public class BasicTriggerEntity extends Model<BasicTriggerEntity> {


	/**
	 * ID
	 */
	@TableId(type = IdType.ASSIGN_ID)
	@Schema(description = "ID")
	private Long id;

	/**
	 * 触发器名称
	 */
	@Schema(description = "触发器名称")
	private String triggerName;


	/**
	 * 数据模板ID
	 */
	@Schema(description = "数据模板ID")
	private Long dataTemplateId;

	/**
	 * 数据模板名称
	 */
	@Schema(description = "数据模板名称")
	private String dataTemplateName;

	/**
	 * 检测因子id
	 */
	@Schema(description = "检测因子id")
	private Long factorId;

	/**
	 * 检测因子名称
	 */
	@Schema(description = "检测因子名称")
	private String factorName;

	/**
	 * 检测因子code
	 */
	@Schema(description = "检测因子code")
	private String factorCode;

	/**
	 * 触发条件
	 */
	@Schema(description = "触发条件")
	private Integer triggerConditions;

	/**
	 * 触发条件值
	 */
	@Schema(description = "触发条件值")
	private BigDecimal triggerConditionsVala;

	private BigDecimal triggerConditionsValb;

	/**
	 * 短信报警 1禁用 2 启用
	 */
	@Schema(description = "短信报警 10禁用 20 启用")
	private Integer smsAlarm;

	/**
	 * 电话报警 1禁用 2 启用
	 */
	@Schema(description = "电话报警 10禁用 20 启用")
	private Integer telephoneAlarm;

	/**
	 * 公众号报警 10禁用 20 启用
	 */
	@Schema(description = "公众号报警 10禁用 20 启用")
	private Integer officialAccountAlarm;


	/**
	 * 状态 1禁用 2 启用
	 */
	@Schema(description = "状态 1禁用 2 启用")
	private Integer status;

	/**
	 * 创建人
	 */
	@TableField(fill = FieldFill.INSERT)
	@Schema(description = "创建人")
	private String createBy;

	/**
	 * 创建时间
	 */
	@TableField(fill = FieldFill.INSERT)
	@Schema(description = "创建时间")
	private LocalDateTime createTime;

	/**
	 * 修改人
	 */
	@TableField(fill = FieldFill.INSERT_UPDATE)
	@Schema(description = "修改人")
	private String updateBy;

	/**
	 * 修改时间
	 */
	@TableField(fill = FieldFill.INSERT_UPDATE)
	@Schema(description = "修改时间")
	private LocalDateTime updateTime;

	/**
	 * delFlag
	 */
	@TableLogic
	@TableField(fill = FieldFill.INSERT)
	@Schema(description = "delFlag")
	private String delFlag;

	/**
	 * 租户ID
	 */
	@Schema(description = "租户ID")
	private Long tenantId;


	/**
	 * 部门ID
	 */
	@Schema(description = "用户所属部门id")
	private Long deptId;

	/**
	 * 部门
	 */
	@Schema(description = "用户所属部门")
	@TableField(exist = false)
	private String deptName;
}